XY2-100 Protocol and PID usage

More
24 Mar 2021 18:40 #203531 by Limedodge
I've been trying to set up a Laser galvanometer controller using a RPi4 and 7i96. The comments on the post below have been SUPER helpful. Thank you!

LinuxCNC support for XY2-100 interface using xy2mod and hostmot2 firmware

Still working to get it fully operational, but I'm learning a ton by tracking down all the errors and researching. Current hang up is "following error" but still working on it.

One thing is still confusing me

In the .HAL example from PCW (thank you), the position cmd signals are routed through a PID, creating a quasi-closed loop system (along with feedback signals from the Hostmot2). Why? Why not just let the motion controller command all the positions (steps) directly and let the card output XY2-100 signals that correspond? I feel like I must be missing something. Since there's no encoder, the "servo loop" doesn't really do anything, right?

Please Log in or Create an account to join the conversation.

More
24 Mar 2021 20:40 #203540 by PCW
Replied by PCW on topic XY2-100 Protocol and PID usage
The reason to run the XY2-100 interface in velocity mode with a PID
closing the position loop and is to get interpolation between waypoints.
If you simply output position waypoints, the galvanometer will move at
an uncontrolled rate between the waypoints. Take a look at the top
(position mode) and bottom (velocity mode) plots here:

forum.linuxcnc.org/27-driver-boards/3985...ware?start=10#182243

Please Log in or Create an account to join the conversation.

More
24 Mar 2021 21:19 #203542 by Limedodge
Wouldn't STEPGEN take care of that for you? Set the step size, velocity,acceleration to match the capabilities of the galvo (ie 16 bit position, scan rate, acceleration). Basically treat it like a very fast stepper motor

Or is the concern that the galvos would outrun even the fastest thread?

Please Log in or Create an account to join the conversation.

More
24 Mar 2021 21:32 - 24 Mar 2021 21:33 #203543 by PCW
Replied by PCW on topic XY2-100 Protocol and PID usage
The stepgen is also run in velocity mode (for similar reasons)

If you want controlled speed between waypoints, the command to the
XY2-100 hardware at the servo thread rate must be velocity
(or velocity and acceleration),not position. This is necessary if you
want the velocity between LinuxCNC position waypoints to be as
programmed in LinuxCNC rather than be determined by the
gavlanometers physical limits, which leads o the "string-of-beads"
appearance of the first plot.
Last edit: 24 Mar 2021 21:33 by PCW.
The following user(s) said Thank You: Limedodge

Please Log in or Create an account to join the conversation.

More
24 Mar 2021 21:35 #203545 by Limedodge
Doh! Never-mind. It donned on me immediately after I replied

Stepgen outputs steps/direction (according to the control logic), The galvo needs a position. So you basically need a PID to act as the velocity, acceleration functions of stepgen, but acting on a constantly varying number (galvo position).

Either that or you'd have to account for the steps/dir using math. ie new position = previous position + step (or minus depending on direction)

Thanks for your response PCW.

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.126 seconds
Powered by Kunena Forum